package com.zx.zxpicture.domain.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zx.zxpicture.domain.picture.entity.Picture;
import com.zx.zxpicture.domain.user.entity.User;
import com.zx.zxpicture.infrstructure.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.zx.zxpicture.interfaces.dto.picture.CreatePictureOutPaintingTaskRequest;
import com.zx.zxpicture.interfaces.dto.picture.PictureEditRequest;
import com.zx.zxpicture.interfaces.dto.picture.PictureQueryRequest;
import com.zx.zxpicture.interfaces.vo.PictureVO;

import java.util.List;

/**
* @author ZX
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-02-19 15:03:21
*/
public interface PictureDomainService extends IService<Picture> {

    /**
     * 获取查询条件
     *
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);
    /**
     * 用户编辑图片
     * @param pictureEditRequest
     * @param loginUser
     */
    public void editPicture(PictureEditRequest pictureEditRequest, User loginUser);

    /**
     * 删除压缩图和缩略图
     * @param oldPicture 压缩图
     */
    public void clearPictureFile(Picture oldPicture);

    /**
     * 根据颜色查询主色调相近的图片
     * @param spaceId 空间id
     * @param picColor 目标主色调
     * @param loginUser 用户
     * @return 图片列表（颜色越相近排名越靠前）
     */
    public List<PictureVO> searchPictureVOByColor(Long spaceId, String picColor, User loginUser);

    /**
     * 创建扩图任务
     * @param request 创建扩图任务请求参数
     * @return 创建扩图任务响应结果
     */
    public CreateOutPaintingTaskResponse createOutPaintingTask(CreatePictureOutPaintingTaskRequest request, User loginUser);
    void validPicture(Picture picture);
}
